package cn.livingCloud.dto;

import cn.livingCloud.entity.content.Button;
import cn.livingCloud.wechat.entity.ButtonType;

/**
 * Created by sujiantang on 2016/1/7.
 */
public class ButtonFormDto {

    private String uuid;

    private String name;

    private ButtonType type;

    private String key;

    private String url;

    private String parent_id;

    public ButtonFormDto() {
    }

    public ButtonFormDto(Button button) {
        load(button);
    }

    public String getUuid() {
        return uuid;
    }

    public ButtonFormDto setUuid(String uuid) {
        this.uuid = uuid;
        return this;
    }

    public String getName() {
        return name;
    }

    public ButtonFormDto setName(String name) {
        this.name = name;
        return this;
    }

    public ButtonType getType() {
        return type;
    }

    public ButtonFormDto setType(ButtonType type) {
        this.type = type;
        return this;
    }

    public String getKey() {
        return key;
    }

    public ButtonFormDto setKey(String key) {
        this.key = key;
        return this;
    }

    public String getUrl() {
        return url;
    }

    public ButtonFormDto setUrl(String url) {
        this.url = url;
        return this;
    }

    public String getParent_id() {
        return parent_id;
    }

    public ButtonFormDto setParent_id(String parent_id) {
        this.parent_id = parent_id;
        return this;
    }

    public void load(Button button) {
        this.uuid = button.getUuid();
        this.name = button.getName();
        this.type = button.getType();
        this.key = button.getKey();
        this.url = button.getUrl();
        this.parent_id = button.getParentId();
    }

    public ButtonType[] getAllButtonType() {
        return ButtonType.values();
    }
}
